package com.ry.bhwktapp.home.ui

//TODO Kt语言中集合的转换与快捷函数的使用
fun main() {
//    定义可变函数
    val mutableListOf = mutableListOf("hhh", "hhh", "kkk", "ggg", "ttt", "rrr")
    println(mutableListOf)
//list转set去重
    val toSet = mutableListOf.toSet()
    println(toSet)
//list转set再转list
    val toList = toSet.toList()
    println(toList)

//    使用快捷函数distinct
    mutableListOf.add("ggg")
    val distinct = mutableListOf.distinct()
    println(distinct)

}